<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    String queryString = request.getQueryString();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>销售管理系统</title>
    <style type="text/css">
        <!--
        body {
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
            overflow:hidden;
        }
        .STYLE3 {color:#ffffff; font-size: 16px; }
        .STYLE4 {
            color: #42870a;
            font-size: 12px;
        }
        #username {
            position:absolute;height:20px; width:180px; border:solid 1px #cadcb2; font-size:14px;font-family:微软雅黑;
        }
        #userpwd {
            position:absolute;height:20px; width:180px; border:solid 1px #cadcb2; font-size:14px;font-family:微软雅黑;
        }
        #checkbox{
            position:absolute;left:56%;top:73%;color:#ffffff;font-family:微软雅黑;font-size:13px;
        }
        -->
    </style></head>

<body>
<div style="position: absolute;width: 100%;height: 100%;">
    <img src="images/houtailogin.jpg" style="width: 100%;height: 100%"></img>
</div>
<form id="loginForm" name="loginForm" action="userLoginController.do?method=login"  method="post" target="hidden_frame">
    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="21%" height="30"><div style="position: absolute;left: 38%;top:60%;"  align="center"><span class="STYLE3"><b>用 户:</b></span></div></td>
            <td width="79%" height="30"><input type="text" id="username" name="username"  style="top:60%;left: 45%;"></td>
        </tr>
        <tr>
            <td height="30"><div style="position: absolute;left: 38%;top:65%" align="center"><span class="STYLE3"><b>密 码:</b></span></div></td>
            <td height="30"><input type="password" id="userpwd" name="userpwd"  style="top:65%;left:45%;"></td></tr>
        </tr>
        <tr>
            <td height="30"><div align="center"><span class="STYLE3"><a href="javascript:void(0);" onclick='window.open("map.do?method=index")' target="_blank"></a></span></div></td>
            <td height="30"><img src="images/login/submit.jpg" width="130" height="30" usemap="#Map" style="position: absolute;left: 45%;top:80%" border="0"></td>
        </tr>
    </table></td>
    <!-- <td width="255" background="images/login/login_08.gif">&nbsp;</td> -->
    </tr>
    </table></td>
    </tr>
    <tr>
        </table></td>
    </tr>
    </table></td>
    </tr>
    <tr>
        <td bgcolor="#a2d962">&nbsp;</td>
    </tr>
    </table>

    <input type="hidden" id="urlStr" name="urlStr" value="<%=queryString%>"/>
    <iframe id="hidden_frame" name="hidden_frame" style="display: none;"></iframe>
</form>
<map name="Map"><area shape="rect" coords="3,3,125,25" href="javascript:void(0);" onclick="userLogin();">
</map>

</body>
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript">
    function userLogin(){
        var username = $("#username").val();
        var userpwd = $("#userpwd").val();
        if(isEmpty(username)){
            alert("请输入用户名！");
            $("#username").focus();
            return;
        }
        if(isEmpty(userpwd)){
            alert("请输入密码！");
            $("#userpwd").focus();
            return;
        }
        $("#loginForm").submit();
    }
    function callback(data,msg){
        if(data=="SUCCESS"){
            window.location.href="pages/index.jsp";
        }else{
            alert(msg);
        }
    }
    $(document).ready(function(){
        var urlStr = $("#urlStr").val();
        if(!isEmpty(urlStr)) {
            $("#loginForm").submit();
        }

    });
    $(document).keydown(function(event){
        var code = event.keyCode;
        if(code==13){
            userLogin();
        }
    });
</script>
</html>
